{% extends 'layout.html' %}

{% block content %}
    <div class="container">

            <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">新增靓号</h3>
            </div>
            <div class="panel-body">
                {% comment %} 在 https://v3.bootcss.com/css/#forms 全局css样式 - 表单 里 {% endcomment %}
                <form method="post" novalidate>  {#action="/info/add/" 可以省略，默认提交到当前url请求; novalidate: 关闭浏览器校验 #}
                    {% csrf_token %}

                    {% for field in form %}
                        <div class="form-group">
{#                            <label>手机号</label>#}
{#                            <input type="text" class="form-control" placeholder="手机号" name="testuser">#}
                            <label>{{ field.label }}</label>
                            {{ field }}
                            <!-- 如果有报错信息，只显示第一条 -->
                            <span style="color: red;">{{ field.errors.0 }}</span>
                        </div>
                    {% endfor %}

                    <button type="submit" class="btn btn-primary">保存</button>
                </form>

            </div>
        </div>

{#    <form method="post">#}
{#        {% csrf_token %}#}
{##}
{#        {{ form.name.label }}: {{ form.name }}#}
{#        {{ form.password.label }}: {{ form.password }}#}
{#        {{ form.age.label }}: {{ form.age }}#}
{#        {% for field in form %}#}
{#        	{{ field.label }}: {{ field }}#}
{#        {% endfor %}#}
{##}
{#    </form>#}

    </div>
{% endblock %}
